home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ainet / ainet32.bas < prev    next >
BASIC Source File  |  1997-07-20  |  5KB  |  87 lines

  1. Attribute VB_Name = "AINET"
  2. ' Last revision: July 11 1997
  3. '
  4. ' Note about VB40 32bit and aiNet32.dll
  5. ' -------------------------------------
  6. '
  7. ' 32 bit C and C++ compilers treat integer as 32bit long.
  8. ' Both versions of Visual Basic (16 and 32 bit) treats Integer as 16 bit long.
  9. ' Therefore we must use Long variable declaration wherever ainet32.dll expects an integer.
  10. ' That is because Long in VB40 is 32 bit long.
  11. '
  12.  
  13. Option Explicit
  14.  
  15. '
  16. ' aiNet function declarations
  17. '
  18. Public Declare Function aiCreateModel Lib "ainet32.dll" (ByVal nModelVectors As Long, ByVal nVariables As Long, ByVal nInpVariables As Long) As Long
  19. Public Declare Function aiCreateModelFromCSVFile Lib "ainet32.dll" (ByVal FileName As String) As Long
  20. Public Declare Function aiDeleteModel Lib "ainet32.dll" (ByVal Model As Long) As Long
  21. Public Declare Function aiNormalize Lib "ainet32.dll" (ByVal Model As Long, ByVal method As Long) As Long
  22. Public Declare Function aiDenormalize Lib "ainet32.dll" (ByVal Model As Long) As Long
  23. Public Declare Function aiRegistration Lib "ainet32.dll" (ByVal user As String, ByVal code As String) As Long
  24. Public Declare Function aiPrediction Lib "ainet32.dll" (ByVal Model As Long, toPredict As Single, ByVal penalty As Single, ByVal method As Long) As Long
  25. Public Declare Function aiGetVariableVB Lib "ainet32.dll" (ByVal Model As Long, ByVal mv As Long, ByVal v As Long, value As Single) As Long
  26. Public Declare Function aiGetVariable Lib "ainet32.dll" (ByVal Model As Long, ByVal mv As Long, ByVal v As Long) As Single
  27. Public Declare Function aiSetVariable Lib "ainet32.dll" (ByVal Model As Long, ByVal mv As Long, ByVal v As Long, ByVal value As Single) As Long
  28. Public Declare Function aiGetCSVFileModelSize Lib "ainet32.dll" (ByVal FileName As String) As Long
  29. Public Declare Function aiGetVersion Lib "ainet32.dll" () As Long
  30. Public Declare Function aiGetNumberOfVariables Lib "ainet32.dll" (ByVal Model As Long) As Long
  31. Public Declare Function aiGetNumberOfModelVectors Lib "ainet32.dll" (ByVal Model As Long) As Long
  32. Public Declare Function aiGetNumberOfInputVariables Lib "ainet32.dll" (ByVal Model As Long) As Long
  33. Public Declare Function aiSetDiscreteFlag Lib "ainet32.dll" (ByVal Model As Long, ByVal v As Long, ByVal f As Long) As Long
  34. Public Declare Function aiGetDiscreteFlag Lib "ainet32.dll" (ByVal Model As Long, ByVal i As Long) As Long
  35. ' new in version 1.24
  36. Public Declare Function aiSetCapacity Lib "ainet32.dll" (ByVal Model As Long, ByVal newCap As Long) As Long
  37. Public Declare Function aiGetCapacity Lib "ainet32.dll" (ByVal Model As Long) As Long
  38. Public Declare Function aiGetFreeEntries Lib "ainet32.dll" (ByVal Model As Long) As Long
  39. Public Declare Function aiInsertModelVector Lib "ainet32.dll" (ByVal Model As Long, ByVal index As Long, NewMV As Single) As Long
  40. Public Declare Function aiOverwriteModelVector Lib "ainet32.dll" (ByVal Model As Long, ByVal index As Long, NewMV As Single) As Long
  41. Public Declare Function aiAppendModelVector Lib "ainet32.dll" (ByVal Model As Long, NewMV As Single) As Long
  42. Public Declare Function aiDeleteModelVector Lib "ainet32.dll" (ByVal Model As Long, ByVal index As Long) As Long
  43. Public Declare Function aiPredictionEx Lib "ainet32.dll" (ByVal Model As Long, toPredict As Single, ByVal penalty As Single, ByVal method As Long, list As Long, ByVal listSize As Long, ByVal listType As Long) As Long
  44. Public Declare Function aiExcludeModelVector Lib "ainet32.dll" (ByVal Model As Long, ByVal i As Long, ByVal exclude As Long) As Long
  45. Public Declare Function aiExcludeModelVectorRange Lib "ainet32.dll" (ByVal Model As Long, ByVal first As Long, ByVal last As Long, ByVal exclude As Long) As Long
  46. Public Declare Function aiIsModelVectorExcluded Lib "ainet32.dll" (ByVal Model As Long, ByVal index As Long) As Long
  47. Public Declare Function aiSaveCSVFile Lib "ainet32.dll" (ByVal Model As Long, ByVal FileName As String) As Long
  48.  
  49. '
  50. ' aiNet error constants
  51. '
  52. Public Const AIERR_NO_ERROR = 0
  53. Public Const AIERR_PENALTY_ZERO = -1
  54. Public Const AIERR_NO_IO_VARIABLES = -2
  55. Public Const AIERR_PENALTY_TOO_SMALL = -3
  56. Public Const AIERR_EMPTY_ROW = -4
  57. Public Const AIERR_EMPTY_COLUMN = -5
  58. Public Const AIERR_EQUAL_COLUMN = -6
  59. Public Const AIERR_CSV_OPEN = -7
  60. Public Const AIERR_CSV_READ = -8
  61. Public Const AIERR_MEMORY_ALLOCATION = -9
  62. Public Const AIERR_INVALID_POINTER = -10
  63. Public Const AIERR_INVALID_INDEX = -11
  64. ' new in version 1.24
  65. Public Const AIERR_NO_FREE_ENTRY = -12
  66.  
  67.  
  68. '
  69. ' Penalty coefficient constants
  70. '
  71. Public Const PENALTY_STATIC = 0
  72. Public Const PENALTY_DYNAMIC = 1
  73. Public Const PENALTY_NEAREST = 2
  74.  
  75. '
  76. ' Normalization constants
  77. '
  78. Public Const NORMALIZE_REGULAR = 0
  79. Public Const NORMALIZE_STATISTICAL = 1
  80.  
  81. '
  82. ' List Influence constants
  83.  
  84. Public Const MOST_INFLUENT = 1
  85. Public Const LEAST_INFLUENT = 0
  86.  
  87.